<template>
	<view :style="[$func.bg('bg.jpg')]" class="main_bg">
		<app-header title="虚拟场景"></app-header>
		<view class="title">
			请选择场景
		</view>
		<view class="list flex-s">
			<view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?id='+item.id)" v-for="(item,index) in list" :key="index">
				<view :style="[$func.bg(item.cate_img)]" class="icon"></view>
				<view class="list_title">进入{{item.cate_name}}</view>
			</view>
			<!-- <view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?s=bedroom')">
				<view :style="[$func.bg('wushi.png')]" class="icon"></view>
				<view class="list_title">进入卧室</view>
			</view>
			<view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?s=living')">
				<view :style="[$func.bg('keting.png')]" class="icon"></view>
				<view class="list_title">进入客厅</view>
			</view>
			<view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?s=bathroom')">
				<view :style="[$func.bg('yushi.png')]" class="icon"></view>
				<view class="list_title">进入浴室</view>
			</view>
			<view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?s=kitchen')">
				<view :style="[$func.bg('chufang.png')]" class="icon"></view>
				<view class="list_title">进入厨房</view>
			</view>
			<view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?s=entryway')">
				<view :style="[$func.bg('xuanguang.png')]" class="icon"></view>
				<view class="list_title">进入玄关</view>
			</view>
			<view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?s=corridor')">
				<view :style="[$func.bg('ludao.png')]" class="icon"></view>
				<view class="list_title">进入楼道</view>
			</view>
			<view class="list_son flex-c" @click="$func.toUrl('/pages/scene/detail?s=community')">
				<view :style="[$func.bg('shequ.png')]" class="icon"></view>
				<view class="list_title">进入社区</view>
			</view> -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.getList()
		},
		methods: {
			getList() {
				this.$http.post("/data/api.auth.User/scene", {}).then(res => {
					this.list = res.data
				})
			}



		}
	}
</script>

<style lang="scss" scoped>
	.title {
		font-size: 44rpx;
		margin: 30rpx;
	}

	.list {
		flex-wrap: wrap;

		.list_son {
			width: 33%;
			flex-direction: column;
			margin: 20rpx 0;


			.icon {
				width: 128rpx;
				height: 128rpx;
				background-size: contain;
			}

			.list_title {
				font-size: 32rpx;
				font-weight: bold;
				margin-top: 10rpx;
			}
		}
	}
</style>